import request from '@/utils/request'

// 创建商品分类
export function createInfoType(data) {
  return request({
    url: '/pharmaceutical/info-type/create',
    method: 'post',
    data: data
  })
}

// 更新商品分类
export function updateInfoType(data) {
  return request({
    url: '/pharmaceutical/info-type/update',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function deleteInfoType(id) {
  return request({
    url: '/pharmaceutical/info-type/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品分类
export function getInfoType(id) {
  return request({
    url: '/pharmaceutical/info-type/get?id=' + id,
    method: 'get'
  })
}

// 获得商品分类分页
export function getInfoTypePage(query) {
  return request({
    url: '/pharmaceutical/info-type/page',
    method: 'get',
    params: query
  })
}

// 导出商品分类 Excel
export function exportInfoTypeExcel(query) {
  return request({
    url: '/pharmaceutical/info-type/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得商品分类列表
export function listType(query) {
  return request({
    url: '/pharmaceutical/info-type/list',
    method: 'get',
    params: query
  })
}

//获取分类列表Tree
export function listTypeTree(query) {
  return request({
    url: '/pharmaceutical/info-type/getProductTypeList',
    method: 'get',
    params: query
  })
}

